<template>
  <div class="child">
    <h3>我是子组件</h3>
    <!-- <h4>{{ money }}</h4> -->
    <GrandChild />
  </div>
</template>

<script setup lang="ts" name="Child">
import { inject } from "vue";
import GrandChild from "./GrandChild.vue";
// 任意后代组件均可接收使用
// let {money} = inject("moneyContext",{money:0});
</script>

<style scoped>
.child {
  margin-top: 20px;
  background-color: skyblue;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px black;
}
</style>
